/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/cat.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __7CC0B9E7_1A11_43BA_9341_106DA554E1B6__
#define __7CC0B9E7_1A11_43BA_9341_106DA554E1B6__

namespace http
{

    /////////////////////////////////////////////////////////////////////////////////
    // 
    // i_servlet
    // 
    class i_servlet : public xos::i_release
    {
    public:
        enum enumRet
        {
            RET_DONE,
            RET_FILTER_FAST_RETURN,
            RET_FAST,
            RET_SLOW,
            RET_CALL
        };

    protected:
        virtual ~i_servlet(){}

    public:
        virtual enumRet proc( i_task * pTask ) = 0;

    };

    /////////////////////////////////////////////////////////////////////////////////
    // 
    // i_servlet_mgr
    // 
    class i_servlet_mgr : public xos::i_release
    {
    protected:
        virtual ~i_servlet_mgr(){}

    public:
        virtual i_servlet * create( const char * lpszName ) = 0;
        virtual const char * path() = 0;
        virtual const char * uri() = 0;
        virtual const char * id() = 0;

    };

    /////////////////////////////////////////////////////////////////////////////////
    // 
    // export function
    // 
    typedef int ( * f_servlet )( xos_container::i_container * pContainer, i_servlet_mgr ** ppv );

} // http

#endif // __7CC0B9E7_1A11_43BA_9341_106DA554E1B6__
